#!/usr/bin/env python3
# Copyright (C) 2020 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

import pytest

from cmk.agent_based.v2 import StringTable
from cmk.plugins.windows.agent_based.libwmi import (
    parse_wmi_table,
    scale_counter,
    WMISection,
    WMITable,
)


class TestWMITable:
    def test_repr(self) -> None:
        assert (
            repr(
                WMITable(
                    "name",
                    ["first header", "second HEADER"],
                    None,
                    123,
                    None,
                    None,
                )
            )
            == "WMITable('name', ['firstheader', 'secondheader'], None, 123, None, [])"
        )


@pytest.mark.parametrize(
    "string_table, section",
    [
        pytest.param(
            [
                ["[system_perf]"],
                [
                    "AlignmentFixupsPersec",
                    "Caption",
                    "ContextSwitchesPersec",
                    "Description",
                    "ExceptionDispatchesPersec",
                    "FileControlBytesPersec",
                    "FileControlOperationsPersec",
                    "FileDataOperationsPersec",
                    "FileReadBytesPersec",
                    "FileReadOperationsPersec",
                    "FileWriteBytesPersec",
                    "FileWriteOperationsPersec",
                    "FloatingEmulationsPersec",
                    "Frequency_Object",
                    "Frequency_PerfTime",
                    "Frequency_Sys100NS",
                    "Name",
                    "PercentRegistryQuotaInUse",
                    "PercentRegistryQuotaInUse_Base",
                    "Processes",
                    "ProcessorQueueLength",
                    "SystemCallsPersec",
                    "SystemUpTime",
                    "Threads",
                    "Timestamp_Object",
                    "Timestamp_PerfTime",
                    "Timestamp_Sys100NS",
                    "WMIStatus",
                ],
                [
                    "0",
                    "",
                    "1401782",
                    "",
                    "4545",
                    "43595392",
                    "735572",
                    "304946",
                    "1995552734",
                    "282564",
                    "376169774",
                    "22382",
                    "0",
                    "10000000",
                    "10000000",
                    "10000000",
                    "",
                    "142602226",
                    "4294967295",
                    "126",
                    "0",
                    "33560181",
                    "132748875394984061",
                    "1151",
                    "132748883397166638",
                    "8004422024",
                    "132748631397160000",
                    "OK",
                ],
                ["[computer_system]"],
                [
                    "AdminPasswordStatus",
                    "AutomaticManagedPagefile",
                    "AutomaticResetBootOption",
                    "AutomaticResetCapability",
                    "BootOptionOnLimit",
                    "BootOptionOnWatchDog",
                    "BootROMSupported",
                    "BootStatus",
                    "BootupState",
                    "Caption",
                    "ChassisBootupState",
                    "ChassisSKUNumber",
                    "CreationClassName",
                    "CurrentTimeZone",
                    "DaylightInEffect",
                    "Description",
                    "DNSHostName",
                    "Domain",
                    "DomainRole",
                    "EnableDaylightSavingsTime",
                    "FrontPanelResetStatus",
                    "HypervisorPresent",
                    "InfraredSupported",
                    "InitialLoadInfo",
                    "InstallDate",
                    "KeyboardPasswordStatus",
                    "LastLoadInfo",
                    "Manufacturer",
                    "Model",
                    "Name",
                    "NameFormat",
                    "NetworkServerModeEnabled",
                    "NumberOfLogicalProcessors",
                    "NumberOfProcessors",
                    "OEMLogoBitmap",
                    "OEMStringArray",
                    "PartOfDomain",
                    "PauseAfterReset",
                    "PCSystemType",
                    "PCSystemTypeEx",
                    "PowerManagementCapabilities",
                    "PowerManagementSupported",
                    "PowerOnPasswordStatus",
                    "PowerState",
                    "PowerSupplyState",
                    "PrimaryOwnerContact",
                    "PrimaryOwnerName",
                    "ResetCapability",
                    "ResetCount",
                    "ResetLimit",
                    "Roles",
                    "Status",
                    "SupportContactDescription",
                    "SystemFamily",
                    "SystemSKUNumber",
                    "SystemStartupDelay",
                    "SystemStartupOptions",
                    "SystemStartupSetting",
                    "SystemType",
                    "ThermalState",
                    "TotalPhysicalMemory",
                    "UserName",
                    "WakeUpType",
                    "Workgroup",
                    "WMIStatus",
                ],
                [
                    "3",
                    "1",
                    "1",
                    "1",
                    "",
                    "",
                    "1",
                    "",
                    "Normal boot",
                    "MSEDGEWIN10",
                    "3",
                    "",
                    "Win32_ComputerSystem",
                    "65116",
                    "1",
                    "AT/AT COMPATIBLE",
                    "MSEDGEWIN10",
                    "WORKGROUP",
                    "0",
                    "1",
                    "3",
                    "1",
                    "0",
                    "",
                    "",
                    "3",
                    "",
                    "innotek GmbH",
                    "VirtualBox",
                    "MSEDGEWIN10",
                    "",
                    "1",
                    "2",
                    "1",
                    "",
                    "<array>",
                    "0",
                    "-1",
                    "2",
                    "2",
                    "",
                    "",
                    "3",
                    "0",
                    "3",
                    "",
                    "",
                    "1",
                    "65535",
                    "65535",
                    "<array>",
                    "OK",
                    "",
                    "Virtual Machine",
                    "",
                    "",
                    "",
                    "",
                    "x64-based PC",
                    "3",
                    "4294496256",
                    "MSEDGEWIN10\\IEUser",
                    "6",
                    "WORKGROUP",
                    "OK",
                ],
            ],
            {
                "system_perf": WMITable(
                    "system_perf",
                    [
                        "alignmentfixupspersec",
                        "caption",
                        "contextswitchespersec",
                        "description",
                        "exceptiondispatchespersec",
                        "filecontrolbytespersec",
                        "filecontroloperationspersec",
                        "filedataoperationspersec",
                        "filereadbytespersec",
                        "filereadoperationspersec",
                        "filewritebytespersec",
                        "filewriteoperationspersec",
                        "floatingemulationspersec",
                        "frequency_object",
                        "frequency_perftime",
                        "frequency_sys100ns",
                        "name",
                        "percentregistryquotainuse",
                        "percentregistryquotainuse_base",
                        "processes",
                        "processorqueuelength",
                        "systemcallspersec",
                        "systemuptime",
                        "threads",
                        "timestamp_object",
                        "timestamp_perftime",
                        "timestamp_sys100ns",
                        "wmistatus",
                    ],
                    "name",
                    None,
                    None,
                    [
                        [
                            "0",
                            "",
                            "1401782",
                            "",
                            "4545",
                            "43595392",
                            "735572",
                            "304946",
                            "1995552734",
                            "282564",
                            "376169774",
                            "22382",
                            "0",
                            "10000000",
                            "10000000",
                            "10000000",
                            "",
                            "142602226",
                            "4294967295",
                            "126",
                            "0",
                            "33560181",
                            "132748875394984061",
                            "1151",
                            "132748883397166638",
                            "8004422024",
                            "132748631397160000",
                            "OK",
                        ],
                    ],
                ),
                "computer_system": WMITable(
                    "computer_system",
                    [
                        "adminpasswordstatus",
                        "automaticmanagedpagefile",
                        "automaticresetbootoption",
                        "automaticresetcapability",
                        "bootoptiononlimit",
                        "bootoptiononwatchdog",
                        "bootromsupported",
                        "bootstatus",
                        "bootupstate",
                        "caption",
                        "chassisbootupstate",
                        "chassisskunumber",
                        "creationclassname",
                        "currenttimezone",
                        "daylightineffect",
                        "description",
                        "dnshostname",
                        "domain",
                        "domainrole",
                        "enabledaylightsavingstime",
                        "frontpanelresetstatus",
                        "hypervisorpresent",
                        "infraredsupported",
                        "initialloadinfo",
                        "installdate",
                        "keyboardpasswordstatus",
                        "lastloadinfo",
                        "manufacturer",
                        "model",
                        "name",
                        "nameformat",
                        "networkservermodeenabled",
                        "numberoflogicalprocessors",
                        "numberofprocessors",
                        "oemlogobitmap",
                        "oemstringarray",
                        "partofdomain",
                        "pauseafterreset",
                        "pcsystemtype",
                        "pcsystemtypeex",
                        "powermanagementcapabilities",
                        "powermanagementsupported",
                        "poweronpasswordstatus",
                        "powerstate",
                        "powersupplystate",
                        "primaryownercontact",
                        "primaryownername",
                        "resetcapability",
                        "resetcount",
                        "resetlimit",
                        "roles",
                        "status",
                        "supportcontactdescription",
                        "systemfamily",
                        "systemskunumber",
                        "systemstartupdelay",
                        "systemstartupoptions",
                        "systemstartupsetting",
                        "systemtype",
                        "thermalstate",
                        "totalphysicalmemory",
                        "username",
                        "wakeuptype",
                        "workgroup",
                        "wmistatus",
                    ],
                    "name",
                    None,
                    None,
                    [
                        [
                            "3",
                            "1",
                            "1",
                            "1",
                            "",
                            "",
                            "1",
                            "",
                            "Normal boot",
                            "MSEDGEWIN10",
                            "3",
                            "",
                            "Win32_ComputerSystem",
                            "65116",
                            "1",
                            "AT/AT COMPATIBLE",
                            "MSEDGEWIN10",
                            "WORKGROUP",
                            "0",
                            "1",
                            "3",
                            "1",
                            "0",
                            "",
                            "",
                            "3",
                            "",
                            "innotek GmbH",
                            "VirtualBox",
                            "MSEDGEWIN10",
                            "",
                            "1",
                            "2",
                            "1",
                            "",
                            "<array>",
                            "0",
                            "-1",
                            "2",
                            "2",
                            "",
                            "",
                            "3",
                            "0",
                            "3",
                            "",
                            "",
                            "1",
                            "65535",
                            "65535",
                            "<array>",
                            "OK",
                            "",
                            "Virtual Machine",
                            "",
                            "",
                            "",
                            "",
                            "x64-based PC",
                            "3",
                            "4294496256",
                            "MSEDGEWIN10\\IEUser",
                            "6",
                            "WORKGROUP",
                            "OK",
                        ],
                    ],
                ),
            },
            id="wmi_cpuload",
        ),
        pytest.param(
            [
                [
                    "AllocatedBytesPersec",
                    "Caption",
                    "Description",
                    "FinalizationSurvivors",
                    "Frequency_Object",
                    "Frequency_PerfTime",
                    "Frequency_Sys100NS",
                    "Gen0heapsize",
                    "Gen0PromotedBytesPerSec",
                    "Gen1heapsize",
                    "Gen1PromotedBytesPerSec",
                    "Gen2heapsize",
                    "LargeObjectHeapsize",
                    "Name",
                    "NumberBytesinallHeaps",
                    "NumberGCHandles",
                    "NumberGen0Collections",
                    "NumberGen1Collections",
                    "NumberGen2Collections",
                    "NumberInducedGC",
                    "NumberofPinnedObjects",
                    "NumberofSinkBlocksinuse",
                    "NumberTotalcommittedBytes",
                    "NumberTotalreservedBytes",
                    "PercentTimeinGC",
                    "PercentTimeinGC_Base",
                    "ProcessID",
                    "PromotedFinalizationMemoryfromGen0",
                    "PromotedMemoryfromGen0",
                    "PromotedMemoryfromGen1",
                    "Timestamp_Object",
                    "Timestamp_PerfTime",
                    "Timestamp_Sys100NS",
                    "WMIStatus",
                ],
                [
                    "83263120",
                    "",
                    "",
                    "18",
                    "0",
                    "10000000",
                    "10000000",
                    "6291456",
                    "560864",
                    "6854408",
                    "0",
                    "4697456",
                    "15047024",
                    "_Global_",
                    "26598888",
                    "278",
                    "7",
                    "3",
                    "2",
                    "0",
                    "0",
                    "45",
                    "32366592",
                    "402644992",
                    "6532",
                    "4294967295",
                    "0",
                    "1344",
                    "560864",
                    "0",
                    "0",
                    "24389501640",
                    "132748647782310000",
                    "OK",
                ],
                [
                    "0",
                    "",
                    "",
                    "0",
                    "0",
                    "10000000",
                    "10000000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "SQLAGENT",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "23",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "24389501640",
                    "132748647782310000",
                    "OK",
                ],
                [
                    "0",
                    "",
                    "",
                    "0",
                    "0",
                    "10000000",
                    "10000000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "sqlservr",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "1",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "24389501640",
                    "132748647782310000",
                    "OK",
                ],
                [
                    "41631560",
                    "",
                    "",
                    "18",
                    "0",
                    "10000000",
                    "10000000",
                    "6291456",
                    "560864",
                    "6854408",
                    "0",
                    "4697456",
                    "15047024",
                    "sqlceip",
                    "26598888",
                    "278",
                    "7",
                    "3",
                    "2",
                    "0",
                    "0",
                    "21",
                    "32366592",
                    "402644992",
                    "13690",
                    "3000412114",
                    "3268",
                    "1344",
                    "560864",
                    "0",
                    "0",
                    "24389501640",
                    "132748647782310000",
                    "OK",
                ],
            ],
            {
                "": WMITable(
                    "",
                    [
                        "allocatedbytespersec",
                        "caption",
                        "description",
                        "finalizationsurvivors",
                        "frequency_object",
                        "frequency_perftime",
                        "frequency_sys100ns",
                        "gen0heapsize",
                        "gen0promotedbytespersec",
                        "gen1heapsize",
                        "gen1promotedbytespersec",
                        "gen2heapsize",
                        "largeobjectheapsize",
                        "name",
                        "numberbytesinallheaps",
                        "numbergchandles",
                        "numbergen0collections",
                        "numbergen1collections",
                        "numbergen2collections",
                        "numberinducedgc",
                        "numberofpinnedobjects",
                        "numberofsinkblocksinuse",
                        "numbertotalcommittedbytes",
                        "numbertotalreservedbytes",
                        "percenttimeingc",
                        "percenttimeingc_base",
                        "processid",
                        "promotedfinalizationmemoryfromgen0",
                        "promotedmemoryfromgen0",
                        "promotedmemoryfromgen1",
                        "timestamp_object",
                        "timestamp_perftime",
                        "timestamp_sys100ns",
                        "wmistatus",
                    ],
                    "name",
                    None,
                    None,
                    [
                        [
                            "83263120",
                            "",
                            "",
                            "18",
                            "0",
                            "10000000",
                            "10000000",
                            "6291456",
                            "560864",
                            "6854408",
                            "0",
                            "4697456",
                            "15047024",
                            "_Global_",
                            "26598888",
                            "278",
                            "7",
                            "3",
                            "2",
                            "0",
                            "0",
                            "45",
                            "32366592",
                            "402644992",
                            "6532",
                            "4294967295",
                            "0",
                            "1344",
                            "560864",
                            "0",
                            "0",
                            "24389501640",
                            "132748647782310000",
                            "OK",
                        ],
                        [
                            "0",
                            "",
                            "",
                            "0",
                            "0",
                            "10000000",
                            "10000000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "SQLAGENT",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "23",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "24389501640",
                            "132748647782310000",
                            "OK",
                        ],
                        [
                            "0",
                            "",
                            "",
                            "0",
                            "0",
                            "10000000",
                            "10000000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "sqlservr",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "1",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "24389501640",
                            "132748647782310000",
                            "OK",
                        ],
                        [
                            "41631560",
                            "",
                            "",
                            "18",
                            "0",
                            "10000000",
                            "10000000",
                            "6291456",
                            "560864",
                            "6854408",
                            "0",
                            "4697456",
                            "15047024",
                            "sqlceip",
                            "26598888",
                            "278",
                            "7",
                            "3",
                            "2",
                            "0",
                            "0",
                            "21",
                            "32366592",
                            "402644992",
                            "13690",
                            "3000412114",
                            "3268",
                            "1344",
                            "560864",
                            "0",
                            "0",
                            "24389501640",
                            "132748647782310000",
                            "OK",
                        ],
                    ],
                ),
            },
            id="dotnet_clrmemory",
        ),
        pytest.param(
            [
                [
                    "AnonymousUsersPersec",
                    "BytesReceivedPersec",
                    "BytesSentPersec",
                    "BytesTotalPersec",
                    "Caption",
                    "CGIRequestsPersec",
                    "ConnectionAttemptsPersec",
                    "CopyRequestsPersec",
                    "CurrentAnonymousUsers",
                    "CurrentBlockedAsyncIORequests",
                    "Currentblockedbandwidthbytes",
                    "CurrentCALcountforauthenticatedusers",
                    "CurrentCALcountforSSLconnections",
                    "CurrentCGIRequests",
                    "CurrentConnections",
                    "CurrentISAPIExtensionRequests",
                    "CurrentNonAnonymousUsers",
                    "DeleteRequestsPersec",
                    "Description",
                    "FilesPersec",
                    "FilesReceivedPersec",
                    "FilesSentPersec",
                    "Frequency_Object",
                    "Frequency_PerfTime",
                    "Frequency_Sys100NS",
                    "GetRequestsPersec",
                    "HeadRequestsPersec",
                    "ISAPIExtensionRequestsPersec",
                    "LockedErrorsPersec",
                    "LockRequestsPersec",
                    "LogonAttemptsPersec",
                    "MaximumAnonymousUsers",
                    "MaximumCALcountforauthenticatedusers",
                    "MaximumCALcountforSSLconnections",
                    "MaximumCGIRequests",
                    "MaximumConnections",
                    "MaximumISAPIExtensionRequests",
                    "MaximumNonAnonymousUsers",
                    "MeasuredAsyncIOBandwidthUsage",
                    "MkcolRequestsPersec",
                    "MoveRequestsPersec",
                    "Name",
                    "NonAnonymousUsersPersec",
                    "NotFoundErrorsPersec",
                    "OptionsRequestsPersec",
                    "OtherRequestMethodsPersec",
                    "PostRequestsPersec",
                    "PropfindRequestsPersec",
                    "ProppatchRequestsPersec",
                    "PutRequestsPersec",
                    "SearchRequestsPersec",
                    "ServiceUptime",
                    "Timestamp_Object",
                    "Timestamp_PerfTime",
                    "Timestamp_Sys100NS",
                    "TotalAllowedAsyncIORequests",
                    "TotalAnonymousUsers",
                    "TotalBlockedAsyncIORequests",
                    "Totalblockedbandwidthbytes",
                    "TotalBytesReceived",
                    "TotalBytesSent",
                    "TotalBytesTransferred",
                    "TotalCGIRequests",
                    "TotalConnectionAttemptsallinstances",
                    "TotalCopyRequests",
                    "TotalcountoffailedCALrequestsforauthenticatedusers",
                    "TotalcountoffailedCALrequestsforSSLconnections",
                    "TotalDeleteRequests",
                    "TotalFilesReceived",
                    "TotalFilesSent",
                    "TotalFilesTransferred",
                    "TotalGetRequests",
                    "TotalHeadRequests",
                    "TotalISAPIExtensionRequests",
                    "TotalLockedErrors",
                    "TotalLockRequests",
                    "TotalLogonAttempts",
                    "TotalMethodRequests",
                    "TotalMethodRequestsPersec",
                    "TotalMkcolRequests",
                    "TotalMoveRequests",
                    "TotalNonAnonymousUsers",
                    "TotalNotFoundErrors",
                    "TotalOptionsRequests",
                    "TotalOtherRequestMethods",
                    "TotalPostRequests",
                    "TotalPropfindRequests",
                    "TotalProppatchRequests",
                    "TotalPutRequests",
                    "TotalRejectedAsyncIORequests",
                    "TotalSearchRequests",
                    "TotalTraceRequests",
                    "TotalUnlockRequests",
                    "TraceRequestsPersec",
                    "UnlockRequestsPersec",
                ],
                [
                    "146391",
                    "2034500749",
                    "6383942732",
                    "8418443481",
                    "",
                    "0",
                    "821014",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "11",
                    "8",
                    "8",
                    "0",
                    "",
                    "33",
                    "0",
                    "33",
                    "0",
                    "1953125",
                    "10000000",
                    "275760",
                    "0",
                    "231138",
                    "0",
                    "0",
                    "1305777",
                    "7",
                    "0",
                    "0",
                    "0",
                    "39",
                    "16",
                    "35",
                    "0",
                    "0",
                    "0",
                    "_Total",
                    "577164",
                    "8",
                    "0",
                    "491115",
                    "779171",
                    "0",
                    "0",
                    "0",
                    "0",
                    "2778588",
                    "0",
                    "6743176430643",
                    "130951777566120000",
                    "0",
                    "146391",
                    "0",
                    "0",
                    "2034500749",
                    "6383942732",
                    "8418443481",
                    "0",
                    "821014",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "33",
                    "33",
                    "275760",
                    "0",
                    "231138",
                    "0",
                    "0",
                    "1305777",
                    "1546056",
                    "1546056",
                    "0",
                    "0",
                    "577164",
                    "8",
                    "0",
                    "491115",
                    "779171",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                ],
                [
                    "44682",
                    "388339380",
                    "3109860488",
                    "3498199868",
                    "",
                    "0",
                    "141001",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "",
                    "3",
                    "0",
                    "3",
                    "0",
                    "1953125",
                    "10000000",
                    "137000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "226055",
                    "5",
                    "0",
                    "0",
                    "0",
                    "17",
                    "0",
                    "14",
                    "0",
                    "0",
                    "0",
                    "Default Web Site",
                    "133797",
                    "8",
                    "0",
                    "28836",
                    "60246",
                    "0",
                    "0",
                    "0",
                    "0",
                    "2778588",
                    "0",
                    "6743176430643",
                    "130951777566120000",
                    "0",
                    "44682",
                    "0",
                    "0",
                    "388339380",
                    "3109860488",
                    "3498199868",
                    "0",
                    "141001",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "3",
                    "3",
                    "137000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "226055",
                    "226086",
                    "226086",
                    "0",
                    "0",
                    "133797",
                    "8",
                    "0",
                    "28836",
                    "60246",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                ],
                [
                    "101709",
                    "1646161369",
                    "3274082244",
                    "4920243613",
                    "",
                    "0",
                    "680013",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "11",
                    "8",
                    "8",
                    "0",
                    "",
                    "30",
                    "0",
                    "30",
                    "0",
                    "1953125",
                    "10000000",
                    "138760",
                    "0",
                    "231138",
                    "0",
                    "0",
                    "1079722",
                    "2",
                    "0",
                    "0",
                    "0",
                    "22",
                    "16",
                    "21",
                    "0",
                    "0",
                    "0",
                    "Exchange Back End",
                    "443367",
                    "0",
                    "0",
                    "462279",
                    "718925",
                    "0",
                    "0",
                    "0",
                    "0",
                    "2778588",
                    "0",
                    "6743176430643",
                    "130951777566120000",
                    "0",
                    "101709",
                    "0",
                    "0",
                    "1646161369",
                    "3274082244",
                    "4920243613",
                    "0",
                    "680013",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "30",
                    "30",
                    "138760",
                    "0",
                    "231138",
                    "0",
                    "0",
                    "1079722",
                    "1319970",
                    "1319970",
                    "0",
                    "0",
                    "443367",
                    "0",
                    "0",
                    "462279",
                    "718925",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                ],
            ],
            {
                "": WMITable(
                    "",
                    [
                        "anonymoususerspersec",
                        "bytesreceivedpersec",
                        "bytessentpersec",
                        "bytestotalpersec",
                        "caption",
                        "cgirequestspersec",
                        "connectionattemptspersec",
                        "copyrequestspersec",
                        "currentanonymoususers",
                        "currentblockedasynciorequests",
                        "currentblockedbandwidthbytes",
                        "currentcalcountforauthenticatedusers",
                        "currentcalcountforsslconnections",
                        "currentcgirequests",
                        "currentconnections",
                        "currentisapiextensionrequests",
                        "currentnonanonymoususers",
                        "deleterequestspersec",
                        "description",
                        "filespersec",
                        "filesreceivedpersec",
                        "filessentpersec",
                        "frequency_object",
                        "frequency_perftime",
                        "frequency_sys100ns",
                        "getrequestspersec",
                        "headrequestspersec",
                        "isapiextensionrequestspersec",
                        "lockederrorspersec",
                        "lockrequestspersec",
                        "logonattemptspersec",
                        "maximumanonymoususers",
                        "maximumcalcountforauthenticatedusers",
                        "maximumcalcountforsslconnections",
                        "maximumcgirequests",
                        "maximumconnections",
                        "maximumisapiextensionrequests",
                        "maximumnonanonymoususers",
                        "measuredasynciobandwidthusage",
                        "mkcolrequestspersec",
                        "moverequestspersec",
                        "name",
                        "nonanonymoususerspersec",
                        "notfounderrorspersec",
                        "optionsrequestspersec",
                        "otherrequestmethodspersec",
                        "postrequestspersec",
                        "propfindrequestspersec",
                        "proppatchrequestspersec",
                        "putrequestspersec",
                        "searchrequestspersec",
                        "serviceuptime",
                        "timestamp_object",
                        "timestamp_perftime",
                        "timestamp_sys100ns",
                        "totalallowedasynciorequests",
                        "totalanonymoususers",
                        "totalblockedasynciorequests",
                        "totalblockedbandwidthbytes",
                        "totalbytesreceived",
                        "totalbytessent",
                        "totalbytestransferred",
                        "totalcgirequests",
                        "totalconnectionattemptsallinstances",
                        "totalcopyrequests",
                        "totalcountoffailedcalrequestsforauthenticatedusers",
                        "totalcountoffailedcalrequestsforsslconnections",
                        "totaldeleterequests",
                        "totalfilesreceived",
                        "totalfilessent",
                        "totalfilestransferred",
                        "totalgetrequests",
                        "totalheadrequests",
                        "totalisapiextensionrequests",
                        "totallockederrors",
                        "totallockrequests",
                        "totallogonattempts",
                        "totalmethodrequests",
                        "totalmethodrequestspersec",
                        "totalmkcolrequests",
                        "totalmoverequests",
                        "totalnonanonymoususers",
                        "totalnotfounderrors",
                        "totaloptionsrequests",
                        "totalotherrequestmethods",
                        "totalpostrequests",
                        "totalpropfindrequests",
                        "totalproppatchrequests",
                        "totalputrequests",
                        "totalrejectedasynciorequests",
                        "totalsearchrequests",
                        "totaltracerequests",
                        "totalunlockrequests",
                        "tracerequestspersec",
                        "unlockrequestspersec",
                        "wmistatus",
                    ],
                    "name",
                    None,
                    None,
                    [
                        [
                            "146391",
                            "2034500749",
                            "6383942732",
                            "8418443481",
                            "",
                            "0",
                            "821014",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "11",
                            "8",
                            "8",
                            "0",
                            "",
                            "33",
                            "0",
                            "33",
                            "0",
                            "1953125",
                            "10000000",
                            "275760",
                            "0",
                            "231138",
                            "0",
                            "0",
                            "1305777",
                            "7",
                            "0",
                            "0",
                            "0",
                            "39",
                            "16",
                            "35",
                            "0",
                            "0",
                            "0",
                            "_Total",
                            "577164",
                            "8",
                            "0",
                            "491115",
                            "779171",
                            "0",
                            "0",
                            "0",
                            "0",
                            "2778588",
                            "0",
                            "6743176430643",
                            "130951777566120000",
                            "0",
                            "146391",
                            "0",
                            "0",
                            "2034500749",
                            "6383942732",
                            "8418443481",
                            "0",
                            "821014",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "33",
                            "33",
                            "275760",
                            "0",
                            "231138",
                            "0",
                            "0",
                            "1305777",
                            "1546056",
                            "1546056",
                            "0",
                            "0",
                            "577164",
                            "8",
                            "0",
                            "491115",
                            "779171",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "OK",
                        ],
                        [
                            "44682",
                            "388339380",
                            "3109860488",
                            "3498199868",
                            "",
                            "0",
                            "141001",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "",
                            "3",
                            "0",
                            "3",
                            "0",
                            "1953125",
                            "10000000",
                            "137000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "226055",
                            "5",
                            "0",
                            "0",
                            "0",
                            "17",
                            "0",
                            "14",
                            "0",
                            "0",
                            "0",
                            "Default Web Site",
                            "133797",
                            "8",
                            "0",
                            "28836",
                            "60246",
                            "0",
                            "0",
                            "0",
                            "0",
                            "2778588",
                            "0",
                            "6743176430643",
                            "130951777566120000",
                            "0",
                            "44682",
                            "0",
                            "0",
                            "388339380",
                            "3109860488",
                            "3498199868",
                            "0",
                            "141001",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "3",
                            "3",
                            "137000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "226055",
                            "226086",
                            "226086",
                            "0",
                            "0",
                            "133797",
                            "8",
                            "0",
                            "28836",
                            "60246",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "OK",
                        ],
                        [
                            "101709",
                            "1646161369",
                            "3274082244",
                            "4920243613",
                            "",
                            "0",
                            "680013",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "11",
                            "8",
                            "8",
                            "0",
                            "",
                            "30",
                            "0",
                            "30",
                            "0",
                            "1953125",
                            "10000000",
                            "138760",
                            "0",
                            "231138",
                            "0",
                            "0",
                            "1079722",
                            "2",
                            "0",
                            "0",
                            "0",
                            "22",
                            "16",
                            "21",
                            "0",
                            "0",
                            "0",
                            "Exchange Back End",
                            "443367",
                            "0",
                            "0",
                            "462279",
                            "718925",
                            "0",
                            "0",
                            "0",
                            "0",
                            "2778588",
                            "0",
                            "6743176430643",
                            "130951777566120000",
                            "0",
                            "101709",
                            "0",
                            "0",
                            "1646161369",
                            "3274082244",
                            "4920243613",
                            "0",
                            "680013",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "30",
                            "30",
                            "138760",
                            "0",
                            "231138",
                            "0",
                            "0",
                            "1079722",
                            "1319970",
                            "1319970",
                            "0",
                            "0",
                            "443367",
                            "0",
                            "0",
                            "462279",
                            "718925",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "OK",
                        ],
                    ],
                ),
            },
            id="wmi_webservices",
        ),
        pytest.param(
            [
                [
                    "ActiveUserCount",
                    "Caption",
                    "ClientBackgroundRPCsFailed",
                    "ClientBackgroundRPCssucceeded",
                    "ClientForegroundRPCsFailed",
                    "ClientForegroundRPCssucceeded",
                    "ClientLatency10secRPCs",
                    "ClientLatency2secRPCs",
                    "ClientLatency5secRPCs",
                    "ClientRPCsattempted",
                    "ClientRPCsFailed",
                    "ClientRPCssucceeded",
                    "ConnectionCount",
                    "Description",
                    "Frequency_Object",
                    "Frequency_PerfTime",
                    "Frequency_Sys100NS",
                    "Name",
                    "RPCAveragedLatency",
                    "RPCClientsBytesRead",
                    "RPCClientsBytesWritten",
                    "RPCClientsUncompressedBytesRead",
                    "RPCClientsUncompressedBytesWritten",
                    "RPCdispatchtaskactivethreads",
                    "RPCdispatchtaskoperationsPersec",
                    "RPCdispatchtaskqueuelength",
                    "RPCdispatchtaskthreads",
                    "RpcHttpConnectionRegistrationdispatchtaskactivethreads",
                    "RpcHttpConnectionRegistrationdispatchtaskoperationsPersec",
                    "RpcHttpConnectionRegistrationdispatchtaskqueuelength",
                    "RpcHttpConnectionRegistrationdispatchtaskthreads",
                    "RPCOperationsPersec",
                    "RPCPacketsPersec",
                    "RPCRequests",
                    "Timestamp_Object",
                    "Timestamp_PerfTime",
                    "Timestamp_Sys100NS",
                    "UserCount",
                    "XTCdispatchtaskactivethreads",
                    "XTCdispatchtaskoperationsPersec",
                    "XTCdispatchtaskqueuelength",
                    "XTCdispatchtaskthreads",
                ],
                [
                    "1",
                    "",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "",
                    "0",
                    "1953125",
                    "10000000",
                    "",
                    "20",
                    "11887803",
                    "53070793",
                    "11887803",
                    "53070793",
                    "0",
                    "229716",
                    "0",
                    "2",
                    "0",
                    "459460",
                    "0",
                    "3",
                    "57429",
                    "172287",
                    "0",
                    "0",
                    "6743176401321",
                    "130951777565960000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                ],
            ],
            {
                "": WMITable(
                    "",
                    [
                        "activeusercount",
                        "caption",
                        "clientbackgroundrpcsfailed",
                        "clientbackgroundrpcssucceeded",
                        "clientforegroundrpcsfailed",
                        "clientforegroundrpcssucceeded",
                        "clientlatency10secrpcs",
                        "clientlatency2secrpcs",
                        "clientlatency5secrpcs",
                        "clientrpcsattempted",
                        "clientrpcsfailed",
                        "clientrpcssucceeded",
                        "connectioncount",
                        "description",
                        "frequency_object",
                        "frequency_perftime",
                        "frequency_sys100ns",
                        "name",
                        "rpcaveragedlatency",
                        "rpcclientsbytesread",
                        "rpcclientsbyteswritten",
                        "rpcclientsuncompressedbytesread",
                        "rpcclientsuncompressedbyteswritten",
                        "rpcdispatchtaskactivethreads",
                        "rpcdispatchtaskoperationspersec",
                        "rpcdispatchtaskqueuelength",
                        "rpcdispatchtaskthreads",
                        "rpchttpconnectionregistrationdispatchtaskactivethreads",
                        "rpchttpconnectionregistrationdispatchtaskoperationspersec",
                        "rpchttpconnectionregistrationdispatchtaskqueuelength",
                        "rpchttpconnectionregistrationdispatchtaskthreads",
                        "rpcoperationspersec",
                        "rpcpacketspersec",
                        "rpcrequests",
                        "timestamp_object",
                        "timestamp_perftime",
                        "timestamp_sys100ns",
                        "usercount",
                        "xtcdispatchtaskactivethreads",
                        "xtcdispatchtaskoperationspersec",
                        "xtcdispatchtaskqueuelength",
                        "xtcdispatchtaskthreads",
                        "wmistatus",
                    ],
                    "name",
                    None,
                    None,
                    [
                        [
                            "1",
                            "",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "",
                            "0",
                            "1953125",
                            "10000000",
                            "",
                            "20",
                            "11887803",
                            "53070793",
                            "11887803",
                            "53070793",
                            "0",
                            "229716",
                            "0",
                            "2",
                            "0",
                            "459460",
                            "0",
                            "3",
                            "57429",
                            "172287",
                            "0",
                            "0",
                            "6743176401321",
                            "130951777565960000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "OK",
                        ],
                    ],
                ),
            },
            id="msexch_rpcclientaccess",
        ),
        pytest.param(
            [
                [
                    "ActiveConversions",
                    "ActiveMailboxSubscriptions",
                    "AggregatedConfigurationReads",
                    "AggregatedConfigurationRebuilds",
                    "AggregatedConfigurationRequests",
                    "ASQueries",
                    "ASQueriesFailurePercent",
                    "AttachmentsUploadedSinceOWAStart",
                    "AverageCheckSpellingTime",
                    "AverageConversionQueuingTime",
                    "AverageConversionTime",
                    "AverageResponseTime",
                    "AverageSearchTime",
                    "CalendarViewRefreshed",
                    "CalendarViewsLoaded",
                    "Caption",
                    "CASCrossSiteRedirectionEarliertoLaterVersion",
                    "CASCrossSiteRedirectionLatertoEarlierVersion",
                    "CASIntraSiteRedirectionEarliertoLaterVersion",
                    "CASIntraSiteRedirectionLatertoEarlierVersion",
                    "ConnectionFailedTransientExceptionPercent",
                    "ConversionRequestsKBPersec",
                    "ConversionResponsesKBPersec",
                    "Conversions",
                    "ConversionsEndedbyTimeout",
                    "ConversionsEndedwithErrors",
                    "CurrentProxyUsers",
                    "CurrentUniqueUsers",
                    "CurrentUniqueUsersLight",
                    "CurrentUniqueUsersPremium",
                    "CurrentUsers",
                    "CurrentUsersLight",
                    "CurrentUsersPremium",
                    "Description",
                    "FailedRequestsPersec",
                    "FailurerateofrequestsfromOWAtoEWS",
                    "Frequency_Object",
                    "Frequency_PerfTime",
                    "Frequency_Sys100NS",
                    "IMAverageSignInTime",
                    "IMMessageDeliveryFailuresPersec",
                    "IMMessagesReceivedPersec",
                    "IMMessagesSentPersec",
                    "IMPresenceQueriesPersec",
                    "IMSentMessageDeliveryFailurePercent",
                    "IMSignInFailurePercent",
                    "IMSignInFailures",
                    "IMSignInFailuresPersec",
                    "IMTotalMessageDeliveryFailures",
                    "IMTotalMessagesReceived",
                    "IMTotalMessagesSent",
                    "IMTotalPresenceQueries",
                    "IMTotalUsers",
                    "IMUsersCurrentlySignedIn",
                    "InvalidCanaryRequests",
                    "IRMprotectedMessagesSent",
                    "ItemsCreatedSinceOWAStart",
                    "ItemsDeletedSinceOWAStart",
                    "ItemsUpdatedSinceOWAStart",
                    "LogonsPersec",
                    "LogonsPersecLight",
                    "LogonsPersecPremium",
                    "MailboxNotificationsPersec",
                    "MailboxOfflineExceptionFailurePercent",
                    "MailViewRefreshes",
                    "MailViewsLoaded",
                    "MessagesSent",
                    "Name",
                    "NamesChecked",
                    "PasswordChanges",
                    "PeakUserCount",
                    "PeakUserCountLight",
                    "PeakUserCountPremium",
                    "PID",
                    "ProxyRequestBytes",
                    "ProxyResponseBytes",
                    "ProxyResponseTimeAverage",
                    "ProxyUserRequests",
                    "ProxyUserRequestsPersec",
                    "QueuedConversionRequests",
                    "RejectedConversions",
                    "Requests",
                    "RequestsFailed",
                    "RequestsPersec",
                    "RequestTimeOuts",
                    "Searches",
                    "SearchesTimedOut",
                    "SenderPhotosLDAPcallsPersec",
                    "SenderPhotosTotalentriesinRecipientsNegativeCache",
                    "SenderPhotosTotalLDAPcalls",
                    "SenderPhotosTotalLDAPcallsreturnednonemptyimagedata",
                    "SenderPhotosTotalnumberofavoidedLDAPcallsduetocache",
                    "SessionDataCachebuildscompleted",
                    "SessionDataCachebuildstarts",
                    "SessionDataCachetimeout",
                    "SessionDataCacheused",
                    "SessionDataCachewaitedforpreloadtocomplete",
                    "SessionsEndedbyLogoff",
                    "SessionsEndedbyTimeout",
                    "SpellingChecks",
                    "StoragePermanentExceptionFailurePercent",
                    "StorageTransientExceptionFailurePercent",
                    "StoreLogonFailurePercent",
                    "SuccessfulConversionRequestsKBPersec",
                    "Timestamp_Object",
                    "Timestamp_PerfTime",
                    "Timestamp_Sys100NS",
                    "TotalMailboxNotifications",
                    "TotalUniqueUsers",
                    "TotalUniqueUsersLight",
                    "TotalUniqueUsersPremium",
                    "TotalUsercontextReInitializationrequests",
                    "TotalUsers",
                    "TotalUsersLight",
                    "TotalUsersPremium",
                    "UNCRequests",
                    "UNCResponseBytes",
                    "UNCResponseBytesPersec",
                    "WSSRequests",
                    "WSSResponseBytes",
                    "WSSResponseBytesPersec",
                ],
                [
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "",
                    "0",
                    "0",
                    "0",
                    "1953125",
                    "10000000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "6743176249526",
                    "130951777565180000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                ],
            ],
            {
                "": WMITable(
                    "",
                    [
                        "activeconversions",
                        "activemailboxsubscriptions",
                        "aggregatedconfigurationreads",
                        "aggregatedconfigurationrebuilds",
                        "aggregatedconfigurationrequests",
                        "asqueries",
                        "asqueriesfailurepercent",
                        "attachmentsuploadedsinceowastart",
                        "averagecheckspellingtime",
                        "averageconversionqueuingtime",
                        "averageconversiontime",
                        "averageresponsetime",
                        "averagesearchtime",
                        "calendarviewrefreshed",
                        "calendarviewsloaded",
                        "caption",
                        "cascrosssiteredirectionearliertolaterversion",
                        "cascrosssiteredirectionlatertoearlierversion",
                        "casintrasiteredirectionearliertolaterversion",
                        "casintrasiteredirectionlatertoearlierversion",
                        "connectionfailedtransientexceptionpercent",
                        "conversionrequestskbpersec",
                        "conversionresponseskbpersec",
                        "conversions",
                        "conversionsendedbytimeout",
                        "conversionsendedwitherrors",
                        "currentproxyusers",
                        "currentuniqueusers",
                        "currentuniqueuserslight",
                        "currentuniqueuserspremium",
                        "currentusers",
                        "currentuserslight",
                        "currentuserspremium",
                        "description",
                        "failedrequestspersec",
                        "failurerateofrequestsfromowatoews",
                        "frequency_object",
                        "frequency_perftime",
                        "frequency_sys100ns",
                        "imaveragesignintime",
                        "immessagedeliveryfailurespersec",
                        "immessagesreceivedpersec",
                        "immessagessentpersec",
                        "impresencequeriespersec",
                        "imsentmessagedeliveryfailurepercent",
                        "imsigninfailurepercent",
                        "imsigninfailures",
                        "imsigninfailurespersec",
                        "imtotalmessagedeliveryfailures",
                        "imtotalmessagesreceived",
                        "imtotalmessagessent",
                        "imtotalpresencequeries",
                        "imtotalusers",
                        "imuserscurrentlysignedin",
                        "invalidcanaryrequests",
                        "irmprotectedmessagessent",
                        "itemscreatedsinceowastart",
                        "itemsdeletedsinceowastart",
                        "itemsupdatedsinceowastart",
                        "logonspersec",
                        "logonsperseclight",
                        "logonspersecpremium",
                        "mailboxnotificationspersec",
                        "mailboxofflineexceptionfailurepercent",
                        "mailviewrefreshes",
                        "mailviewsloaded",
                        "messagessent",
                        "name",
                        "nameschecked",
                        "passwordchanges",
                        "peakusercount",
                        "peakusercountlight",
                        "peakusercountpremium",
                        "pid",
                        "proxyrequestbytes",
                        "proxyresponsebytes",
                        "proxyresponsetimeaverage",
                        "proxyuserrequests",
                        "proxyuserrequestspersec",
                        "queuedconversionrequests",
                        "rejectedconversions",
                        "requests",
                        "requestsfailed",
                        "requestspersec",
                        "requesttimeouts",
                        "searches",
                        "searchestimedout",
                        "senderphotosldapcallspersec",
                        "senderphotostotalentriesinrecipientsnegativecache",
                        "senderphotostotalldapcalls",
                        "senderphotostotalldapcallsreturnednonemptyimagedata",
                        "senderphotostotalnumberofavoidedldapcallsduetocache",
                        "sessiondatacachebuildscompleted",
                        "sessiondatacachebuildstarts",
                        "sessiondatacachetimeout",
                        "sessiondatacacheused",
                        "sessiondatacachewaitedforpreloadtocomplete",
                        "sessionsendedbylogoff",
                        "sessionsendedbytimeout",
                        "spellingchecks",
                        "storagepermanentexceptionfailurepercent",
                        "storagetransientexceptionfailurepercent",
                        "storelogonfailurepercent",
                        "successfulconversionrequestskbpersec",
                        "timestamp_object",
                        "timestamp_perftime",
                        "timestamp_sys100ns",
                        "totalmailboxnotifications",
                        "totaluniqueusers",
                        "totaluniqueuserslight",
                        "totaluniqueuserspremium",
                        "totalusercontextreinitializationrequests",
                        "totalusers",
                        "totaluserslight",
                        "totaluserspremium",
                        "uncrequests",
                        "uncresponsebytes",
                        "uncresponsebytespersec",
                        "wssrequests",
                        "wssresponsebytes",
                        "wssresponsebytespersec",
                        "wmistatus",
                    ],
                    "name",
                    None,
                    None,
                    [
                        [
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "",
                            "0",
                            "0",
                            "0",
                            "1953125",
                            "10000000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "6743176249526",
                            "130951777565180000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "OK",
                        ],
                    ],
                ),
            },
            id="msexch_owa",
        ),
        pytest.param(
            [
                [
                    "Activemailboxes",
                    "AverageKeywordStatsSearchExecutionTime",
                    "AverageKeywordStatsSearchExecutionTime_Base",
                    "AverageMultiMailboxSearchFailed",
                    "AverageMultiMailboxSearchFailed_Base",
                    "AverageMultiMailboxSearchQueryLength",
                    "AverageMultiMailboxSearchQueryLength_Base",
                    "AverageMultiMailboxSearchtimespentinFullTextIndex",
                    "AverageMultiMailboxSearchtimespentinFullTextIndex_Base",
                    "AverageMultiMailboxSearchtimespentinStorecalls",
                    "AverageMultiMailboxSearchtimespentinStorecalls_Base",
                    "AveragenumberofKeywordsinMultiMailboxSearch",
                    "AveragenumberofKeywordsinMultiMailboxSearch_Base",
                    "AverageSearchExecutionTime",
                    "AverageSearchExecutionTime_Base",
                    "Averagesearchresultsperquery",
                    "Averagesearchresultsperquery_Base",
                    "CachedeletesintheAddressInfocachePersec",
                    "CachedeletesintheDatabaseInfocachePersec",
                    "CachedeletesintheDistributionListMembershipcachePersec",
                    "CachedeletesintheForeignAddressInfocachePersec",
                    "CachedeletesintheForeignMailboxInfocachePersec",
                    "CachedeletesintheIncompleteAddressInfocachePersec",
                    "CachedeletesintheLogicalIndexcachePersec",
                    "CachedeletesintheMailboxInfocachePersec",
                    "CachedeletesintheOrganizationContainercachePersec",
                    "CachehitsintheAddressInfocachePersec",
                    "CachehitsintheDatabaseInfocachePersec",
                    "CachehitsintheDistributionListMembershipcachePersec",
                    "CachehitsintheForeignAddressInfocachePersec",
                    "CachehitsintheForeignMailboxInfocachePersec",
                    "CachehitsintheIncompleteAddressInfocachePersec",
                    "CachehitsintheLogicalIndexcachePersec",
                    "CachehitsintheMailboxInfocachePersec",
                    "CachehitsintheOrganizationContainercachePersec",
                    "CacheinsertsintheAddressInfocachePersec",
                    "CacheinsertsintheDatabaseInfocachePersec",
                    "CacheinsertsintheDistributionListMembershipcachePersec",
                    "CacheinsertsintheForeignAddressInfocachePersec",
                    "CacheinsertsintheForeignMailboxInfocachePersec",
                    "CacheinsertsintheIncompleteAddressInfocachePersec",
                    "CacheinsertsintheLogicalIndexcachePersec",
                    "CacheinsertsintheMailboxInfocachePersec",
                    "CacheinsertsintheOrganizationContainercachePersec",
                    "CachelookupsintheAddressInfocachePersec",
                    "CachelookupsintheDatabaseInfocachePersec",
                    "CachelookupsintheDistributionListMembershipcachePersec",
                    "CachelookupsintheForeignAddressInfocachePersec",
                    "CachelookupsintheForeignMailboxInfocachePersec",
                    "CachelookupsintheIncompleteAddressInfocachePersec",
                    "CachelookupsintheLogicalIndexcachePersec",
                    "CachelookupsintheMailboxInfocachePersec",
                    "CachelookupsintheOrganizationContainercachePersec",
                    "CachemissesintheAddressInfocachePersec",
                    "CachemissesintheDatabaseInfocachePersec",
                    "CachemissesintheDistributionListMembershipcachePersec",
                    "CachemissesintheForeignAddressInfocachePersec",
                    "CachemissesintheForeignMailboxInfocachePersec",
                    "CachemissesintheIncompleteAddressInfocachePersec",
                    "CachemissesintheLogicalIndexcachePersec",
                    "CachemissesintheMailboxInfocachePersec",
                    "CachemissesintheOrganizationContainercachePersec",
                    "Caption",
                    "DatabaseLevelMaintenancesPersec",
                    "DatabaseState",
                    "Description",
                    "FolderscreatedPersec",
                    "FoldersdeletedPersec",
                    "FoldersopenedPersec",
                    "Frequency_Object",
                    "Frequency_PerfTime",
                    "Frequency_Sys100NS",
                    "IntegrityCheckDropBusyJobs",
                    "IntegrityCheckFailedJobs",
                    "IntegrityCheckPendingJobs",
                    "IntegrityCheckTotalJobs",
                    "LastMaintenanceItemRequestedAge",
                    "Lazyindexchunkedpopulations",
                    "LazyindexescreatedPersec",
                    "LazyindexesdeletedPersec",
                    "LazyindexfullrefreshPersec",
                    "LazyindexincrementalrefreshPersec",
                    "LazyindexinvalidationduetolocaleversionchangePersec",
                    "LazyindexinvalidationPersec",
                    "Lazyindexnonchunkedpopulations",
                    "Lazyindexpopulationsfromindex",
                    "Lazyindexpopulationswithouttransactionpulsing",
                    "Lazyindextotalpopulations",
                    "LostDiagnosticEntries",
                    "MailboxesWithMaintenanceItems",
                    "MailboxKeyDecryptAverageLatency",
                    "MailboxKeyDecryptAverageLatency_Base",
                    "MailboxKeyDecryptsPersec",
                    "MailboxKeyEncryptsPersec",
                    "MailboxLevelMaintenanceItems",
                    "MailboxLevelMaintenancesPersec",
                    "MAPIMessagesCreatedPersec",
                    "MAPIMessagesModifiedPersec",
                    "MAPIMessagesOpenedPersec",
                    "MessagescreatedPersec",
                    "MessagesdeletedPersec",
                    "MessagesDeliveredPersec",
                    "MessagesopenedPersec",
                    "MessagesSubmittedPersec",
                    "MessagesupdatedPersec",
                    "MultiMailboxKeywordStatsSearchPersec",
                    "MultiMailboxPreviewSearchPersec",
                    "MultiMailboxSearchFullTextIndexQueryPersec",
                    "Name",
                    "NonrecursivefolderhierarchyreloadsPersec",
                    "Numberofactivebackgroundtasks",
                    "NumberofactiveWLMLogicalIndexmaintenancetablemaintenances",
                    "NumberofmailboxesmarkedforWLMLogicalIndexmaintenancetablemaintenance",
                    "NumberofprocessingLogicalIndexmaintenancetasks",
                    "NumberofscheduledLogicalIndexmaintenancetasks",
                    "PercentRPCRequests",
                    "PercentRPCRequests_Base",
                    "ProcessID",
                    "PropertypromotionmessagesPersec",
                    "PropertypromotionsPersec",
                    "PropertyPromotionTasks",
                    "QuarantinedComponentCount",
                    "QuarantinedMailboxCount",
                    "QuarantinedSchemaUpgraderCount",
                    "QuarantinedUserAccessibleMailboxCount",
                    "RecursivefolderhierarchyreloadsPersec",
                    "RPCAverageLatency",
                    "RPCAverageLatency_Base",
                    "RPCOperationsPersec",
                    "RPCPacketsPersec",
                    "RPCPoolContextHandles",
                    "RPCPoolParkedAsyncNotificationCalls",
                    "RPCPoolPools",
                    "RPCRequests",
                    "ScheduledISIntegDetectedCount",
                    "ScheduledISIntegFixedCount",
                    "ScheduledISIntegPersec",
                    "ScopeKeyReadAverageLatency",
                    "ScopeKeyReadAverageLatency_Base",
                    "ScopeKeyReadsPersec",
                    "SearchPersec",
                    "SearchresultsPersec",
                    "SizeofAddressInfocache",
                    "SizeofDatabaseInfocache",
                    "SizeofDistributionListMembershipcache",
                    "SizeofForeignAddressInfocache",
                    "SizeofForeignMailboxInfocache",
                    "SizeofIncompleteAddressInfocache",
                    "SizeofLogicalIndexcache",
                    "SizeofMailboxInfocache",
                    "SizeofOrganizationContainercache",
                    "SizeoftheexpirationqueuefortheAddressInfocache",
                    "SizeoftheexpirationqueuefortheDatabaseInfocache",
                    "SizeoftheexpirationqueuefortheDistributionListMembershipcache",
                    "SizeoftheexpirationqueuefortheForeignAddressInfocache",
                    "SizeoftheexpirationqueuefortheForeignMailboxInfocache",
                    "SizeoftheexpirationqueuefortheIncompleteAddressInfocache",
                    "SizeoftheexpirationqueuefortheLogicalIndexcache",
                    "SizeoftheexpirationqueuefortheMailboxInfocache",
                    "SizeoftheexpirationqueuefortheOrganizationContainercache",
                    "SubobjectscleanedPersec",
                    "SubobjectscreatedPersec",
                    "SubobjectsdeletedPersec",
                    "Subobjectsintombstone",
                    "SubobjectsopenedPersec",
                    "SuccessfulsearchPersec",
                    "TimedEventsProcessed",
                    "TimedEventsProcessedPersec",
                    "TimedEventsProcessingFailures",
                    "Timestamp_Object",
                    "Timestamp_PerfTime",
                    "Timestamp_Sys100NS",
                    "TopMessagescleanedPersec",
                    "Topmessagesintombstone",
                    "TotalfailedmultimailboxkeywordstatisticsSearches",
                    "TotalfailedmultimailboxPreviewSearches",
                    "TotalMultiMailboxkeywordstatisticssearches",
                    "Totalmultimailboxkeywordstatisticssearchestimedout",
                    "TotalMultiMailboxpreviewsearches",
                    "Totalmultimailboxpreviewsearchestimedout",
                    "TotalMultiMailboxsearchesfailedduetoFullTextfailure",
                    "TotalmultimailboxsearchesFullTextIndexQueryExecution",
                    "Totalnumberofsuccessfulsearchqueries",
                    "Totalobjectssizeintombstonebytes",
                    "Totalsearches",
                    "Totalsearchesinprogress",
                    "Totalsearchqueriescompletedin005sec",
                    "Totalsearchqueriescompletedin052sec",
                    "Totalsearchqueriescompletedin1060sec",
                    "Totalsearchqueriescompletedin210sec",
                    "Totalsearchqueriescompletedin60sec",
                ],
                [
                    "4",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "11705",
                    "2038",
                    "0",
                    "0",
                    "0",
                    "0",
                    "52",
                    "7962",
                    "0",
                    "12671984",
                    "18440396",
                    "0",
                    "0",
                    "0",
                    "0",
                    "639930",
                    "6127781",
                    "0",
                    "11708",
                    "2038",
                    "0",
                    "0",
                    "0",
                    "0",
                    "623",
                    "7964",
                    "0",
                    "12684158",
                    "18442669",
                    "0",
                    "12174",
                    "8514",
                    "0",
                    "641176",
                    "6136295",
                    "0",
                    "12174",
                    "2273",
                    "0",
                    "12174",
                    "8514",
                    "0",
                    "1246",
                    "8514",
                    "0",
                    "",
                    "11724",
                    "1",
                    "",
                    "0",
                    "0",
                    "1220570",
                    "0",
                    "1953125",
                    "10000000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "3",
                    "24",
                    "3",
                    "838",
                    "0",
                    "0",
                    "0",
                    "2",
                    "0",
                    "3",
                    "0",
                    "1",
                    "0",
                    "0",
                    "0",
                    "0",
                    "1",
                    "11680",
                    "40243",
                    "51785",
                    "66714",
                    "80486",
                    "23006",
                    "28741",
                    "101226",
                    "11502",
                    "23140",
                    "0",
                    "0",
                    "0",
                    "db3",
                    "0",
                    "0",
                    "0",
                    "1",
                    "0",
                    "0",
                    "0",
                    "50",
                    "5716",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "284",
                    "1977204",
                    "4308720",
                    "6138327",
                    "4308720",
                    "23304",
                    "8",
                    "11650",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "3",
                    "1",
                    "0",
                    "0",
                    "0",
                    "0",
                    "8",
                    "2",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "6743176366056",
                    "130951777565810000",
                    "23004",
                    "2",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                ],
                [
                    "4",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "11705",
                    "2038",
                    "0",
                    "0",
                    "0",
                    "0",
                    "52",
                    "7962",
                    "0",
                    "12671984",
                    "18440397",
                    "0",
                    "0",
                    "0",
                    "0",
                    "639930",
                    "6127781",
                    "0",
                    "11708",
                    "2039",
                    "0",
                    "0",
                    "0",
                    "0",
                    "623",
                    "7964",
                    "0",
                    "12684158",
                    "18442671",
                    "0",
                    "12174",
                    "8514",
                    "0",
                    "641176",
                    "6136295",
                    "0",
                    "12174",
                    "2274",
                    "0",
                    "12174",
                    "8514",
                    "0",
                    "1246",
                    "8514",
                    "0",
                    "",
                    "11724",
                    "1",
                    "",
                    "0",
                    "0",
                    "1220570",
                    "0",
                    "1953125",
                    "10000000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "3",
                    "24",
                    "3",
                    "838",
                    "0",
                    "0",
                    "0",
                    "2",
                    "0",
                    "3",
                    "0",
                    "1",
                    "0",
                    "0",
                    "0",
                    "0",
                    "1",
                    "11680",
                    "40243",
                    "51785",
                    "66714",
                    "80486",
                    "23006",
                    "28741",
                    "101226",
                    "11502",
                    "23140",
                    "0",
                    "0",
                    "0",
                    "_total",
                    "0",
                    "0",
                    "0",
                    "1",
                    "0",
                    "0",
                    "0",
                    "50",
                    "5716",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "284",
                    "1977204",
                    "4308720",
                    "6138327",
                    "4308720",
                    "23336",
                    "9",
                    "11651",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "3",
                    "2",
                    "0",
                    "0",
                    "0",
                    "0",
                    "8",
                    "2",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "6743176366056",
                    "130951777565810000",
                    "23004",
                    "2",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                ],
            ],
            {
                "": WMITable(
                    "",
                    [
                        "activemailboxes",
                        "averagekeywordstatssearchexecutiontime",
                        "averagekeywordstatssearchexecutiontime_base",
                        "averagemultimailboxsearchfailed",
                        "averagemultimailboxsearchfailed_base",
                        "averagemultimailboxsearchquerylength",
                        "averagemultimailboxsearchquerylength_base",
                        "averagemultimailboxsearchtimespentinfulltextindex",
                        "averagemultimailboxsearchtimespentinfulltextindex_base",
                        "averagemultimailboxsearchtimespentinstorecalls",
                        "averagemultimailboxsearchtimespentinstorecalls_base",
                        "averagenumberofkeywordsinmultimailboxsearch",
                        "averagenumberofkeywordsinmultimailboxsearch_base",
                        "averagesearchexecutiontime",
                        "averagesearchexecutiontime_base",
                        "averagesearchresultsperquery",
                        "averagesearchresultsperquery_base",
                        "cachedeletesintheaddressinfocachepersec",
                        "cachedeletesinthedatabaseinfocachepersec",
                        "cachedeletesinthedistributionlistmembershipcachepersec",
                        "cachedeletesintheforeignaddressinfocachepersec",
                        "cachedeletesintheforeignmailboxinfocachepersec",
                        "cachedeletesintheincompleteaddressinfocachepersec",
                        "cachedeletesinthelogicalindexcachepersec",
                        "cachedeletesinthemailboxinfocachepersec",
                        "cachedeletesintheorganizationcontainercachepersec",
                        "cachehitsintheaddressinfocachepersec",
                        "cachehitsinthedatabaseinfocachepersec",
                        "cachehitsinthedistributionlistmembershipcachepersec",
                        "cachehitsintheforeignaddressinfocachepersec",
                        "cachehitsintheforeignmailboxinfocachepersec",
                        "cachehitsintheincompleteaddressinfocachepersec",
                        "cachehitsinthelogicalindexcachepersec",
                        "cachehitsinthemailboxinfocachepersec",
                        "cachehitsintheorganizationcontainercachepersec",
                        "cacheinsertsintheaddressinfocachepersec",
                        "cacheinsertsinthedatabaseinfocachepersec",
                        "cacheinsertsinthedistributionlistmembershipcachepersec",
                        "cacheinsertsintheforeignaddressinfocachepersec",
                        "cacheinsertsintheforeignmailboxinfocachepersec",
                        "cacheinsertsintheincompleteaddressinfocachepersec",
                        "cacheinsertsinthelogicalindexcachepersec",
                        "cacheinsertsinthemailboxinfocachepersec",
                        "cacheinsertsintheorganizationcontainercachepersec",
                        "cachelookupsintheaddressinfocachepersec",
                        "cachelookupsinthedatabaseinfocachepersec",
                        "cachelookupsinthedistributionlistmembershipcachepersec",
                        "cachelookupsintheforeignaddressinfocachepersec",
                        "cachelookupsintheforeignmailboxinfocachepersec",
                        "cachelookupsintheincompleteaddressinfocachepersec",
                        "cachelookupsinthelogicalindexcachepersec",
                        "cachelookupsinthemailboxinfocachepersec",
                        "cachelookupsintheorganizationcontainercachepersec",
                        "cachemissesintheaddressinfocachepersec",
                        "cachemissesinthedatabaseinfocachepersec",
                        "cachemissesinthedistributionlistmembershipcachepersec",
                        "cachemissesintheforeignaddressinfocachepersec",
                        "cachemissesintheforeignmailboxinfocachepersec",
                        "cachemissesintheincompleteaddressinfocachepersec",
                        "cachemissesinthelogicalindexcachepersec",
                        "cachemissesinthemailboxinfocachepersec",
                        "cachemissesintheorganizationcontainercachepersec",
                        "caption",
                        "databaselevelmaintenancespersec",
                        "databasestate",
                        "description",
                        "folderscreatedpersec",
                        "foldersdeletedpersec",
                        "foldersopenedpersec",
                        "frequency_object",
                        "frequency_perftime",
                        "frequency_sys100ns",
                        "integritycheckdropbusyjobs",
                        "integritycheckfailedjobs",
                        "integritycheckpendingjobs",
                        "integritychecktotaljobs",
                        "lastmaintenanceitemrequestedage",
                        "lazyindexchunkedpopulations",
                        "lazyindexescreatedpersec",
                        "lazyindexesdeletedpersec",
                        "lazyindexfullrefreshpersec",
                        "lazyindexincrementalrefreshpersec",
                        "lazyindexinvalidationduetolocaleversionchangepersec",
                        "lazyindexinvalidationpersec",
                        "lazyindexnonchunkedpopulations",
                        "lazyindexpopulationsfromindex",
                        "lazyindexpopulationswithouttransactionpulsing",
                        "lazyindextotalpopulations",
                        "lostdiagnosticentries",
                        "mailboxeswithmaintenanceitems",
                        "mailboxkeydecryptaveragelatency",
                        "mailboxkeydecryptaveragelatency_base",
                        "mailboxkeydecryptspersec",
                        "mailboxkeyencryptspersec",
                        "mailboxlevelmaintenanceitems",
                        "mailboxlevelmaintenancespersec",
                        "mapimessagescreatedpersec",
                        "mapimessagesmodifiedpersec",
                        "mapimessagesopenedpersec",
                        "messagescreatedpersec",
                        "messagesdeletedpersec",
                        "messagesdeliveredpersec",
                        "messagesopenedpersec",
                        "messagessubmittedpersec",
                        "messagesupdatedpersec",
                        "multimailboxkeywordstatssearchpersec",
                        "multimailboxpreviewsearchpersec",
                        "multimailboxsearchfulltextindexquerypersec",
                        "name",
                        "nonrecursivefolderhierarchyreloadspersec",
                        "numberofactivebackgroundtasks",
                        "numberofactivewlmlogicalindexmaintenancetablemaintenances",
                        "numberofmailboxesmarkedforwlmlogicalindexmaintenancetablemaintenance",
                        "numberofprocessinglogicalindexmaintenancetasks",
                        "numberofscheduledlogicalindexmaintenancetasks",
                        "percentrpcrequests",
                        "percentrpcrequests_base",
                        "processid",
                        "propertypromotionmessagespersec",
                        "propertypromotionspersec",
                        "propertypromotiontasks",
                        "quarantinedcomponentcount",
                        "quarantinedmailboxcount",
                        "quarantinedschemaupgradercount",
                        "quarantineduseraccessiblemailboxcount",
                        "recursivefolderhierarchyreloadspersec",
                        "rpcaveragelatency",
                        "rpcaveragelatency_base",
                        "rpcoperationspersec",
                        "rpcpacketspersec",
                        "rpcpoolcontexthandles",
                        "rpcpoolparkedasyncnotificationcalls",
                        "rpcpoolpools",
                        "rpcrequests",
                        "scheduledisintegdetectedcount",
                        "scheduledisintegfixedcount",
                        "scheduledisintegpersec",
                        "scopekeyreadaveragelatency",
                        "scopekeyreadaveragelatency_base",
                        "scopekeyreadspersec",
                        "searchpersec",
                        "searchresultspersec",
                        "sizeofaddressinfocache",
                        "sizeofdatabaseinfocache",
                        "sizeofdistributionlistmembershipcache",
                        "sizeofforeignaddressinfocache",
                        "sizeofforeignmailboxinfocache",
                        "sizeofincompleteaddressinfocache",
                        "sizeoflogicalindexcache",
                        "sizeofmailboxinfocache",
                        "sizeoforganizationcontainercache",
                        "sizeoftheexpirationqueuefortheaddressinfocache",
                        "sizeoftheexpirationqueueforthedatabaseinfocache",
                        "sizeoftheexpirationqueueforthedistributionlistmembershipcache",
                        "sizeoftheexpirationqueuefortheforeignaddressinfocache",
                        "sizeoftheexpirationqueuefortheforeignmailboxinfocache",
                        "sizeoftheexpirationqueuefortheincompleteaddressinfocache",
                        "sizeoftheexpirationqueueforthelogicalindexcache",
                        "sizeoftheexpirationqueueforthemailboxinfocache",
                        "sizeoftheexpirationqueuefortheorganizationcontainercache",
                        "subobjectscleanedpersec",
                        "subobjectscreatedpersec",
                        "subobjectsdeletedpersec",
                        "subobjectsintombstone",
                        "subobjectsopenedpersec",
                        "successfulsearchpersec",
                        "timedeventsprocessed",
                        "timedeventsprocessedpersec",
                        "timedeventsprocessingfailures",
                        "timestamp_object",
                        "timestamp_perftime",
                        "timestamp_sys100ns",
                        "topmessagescleanedpersec",
                        "topmessagesintombstone",
                        "totalfailedmultimailboxkeywordstatisticssearches",
                        "totalfailedmultimailboxpreviewsearches",
                        "totalmultimailboxkeywordstatisticssearches",
                        "totalmultimailboxkeywordstatisticssearchestimedout",
                        "totalmultimailboxpreviewsearches",
                        "totalmultimailboxpreviewsearchestimedout",
                        "totalmultimailboxsearchesfailedduetofulltextfailure",
                        "totalmultimailboxsearchesfulltextindexqueryexecution",
                        "totalnumberofsuccessfulsearchqueries",
                        "totalobjectssizeintombstonebytes",
                        "totalsearches",
                        "totalsearchesinprogress",
                        "totalsearchqueriescompletedin005sec",
                        "totalsearchqueriescompletedin052sec",
                        "totalsearchqueriescompletedin1060sec",
                        "totalsearchqueriescompletedin210sec",
                        "totalsearchqueriescompletedin60sec",
                        "wmistatus",
                    ],
                    "name",
                    None,
                    None,
                    [
                        [
                            "4",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "11705",
                            "2038",
                            "0",
                            "0",
                            "0",
                            "0",
                            "52",
                            "7962",
                            "0",
                            "12671984",
                            "18440396",
                            "0",
                            "0",
                            "0",
                            "0",
                            "639930",
                            "6127781",
                            "0",
                            "11708",
                            "2038",
                            "0",
                            "0",
                            "0",
                            "0",
                            "623",
                            "7964",
                            "0",
                            "12684158",
                            "18442669",
                            "0",
                            "12174",
                            "8514",
                            "0",
                            "641176",
                            "6136295",
                            "0",
                            "12174",
                            "2273",
                            "0",
                            "12174",
                            "8514",
                            "0",
                            "1246",
                            "8514",
                            "0",
                            "",
                            "11724",
                            "1",
                            "",
                            "0",
                            "0",
                            "1220570",
                            "0",
                            "1953125",
                            "10000000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "3",
                            "24",
                            "3",
                            "838",
                            "0",
                            "0",
                            "0",
                            "2",
                            "0",
                            "3",
                            "0",
                            "1",
                            "0",
                            "0",
                            "0",
                            "0",
                            "1",
                            "11680",
                            "40243",
                            "51785",
                            "66714",
                            "80486",
                            "23006",
                            "28741",
                            "101226",
                            "11502",
                            "23140",
                            "0",
                            "0",
                            "0",
                            "db3",
                            "0",
                            "0",
                            "0",
                            "1",
                            "0",
                            "0",
                            "0",
                            "50",
                            "5716",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "284",
                            "1977204",
                            "4308720",
                            "6138327",
                            "4308720",
                            "23304",
                            "8",
                            "11650",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "3",
                            "1",
                            "0",
                            "0",
                            "0",
                            "0",
                            "8",
                            "2",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "6743176366056",
                            "130951777565810000",
                            "23004",
                            "2",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "OK",
                        ],
                        [
                            "4",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "11705",
                            "2038",
                            "0",
                            "0",
                            "0",
                            "0",
                            "52",
                            "7962",
                            "0",
                            "12671984",
                            "18440397",
                            "0",
                            "0",
                            "0",
                            "0",
                            "639930",
                            "6127781",
                            "0",
                            "11708",
                            "2039",
                            "0",
                            "0",
                            "0",
                            "0",
                            "623",
                            "7964",
                            "0",
                            "12684158",
                            "18442671",
                            "0",
                            "12174",
                            "8514",
                            "0",
                            "641176",
                            "6136295",
                            "0",
                            "12174",
                            "2274",
                            "0",
                            "12174",
                            "8514",
                            "0",
                            "1246",
                            "8514",
                            "0",
                            "",
                            "11724",
                            "1",
                            "",
                            "0",
                            "0",
                            "1220570",
                            "0",
                            "1953125",
                            "10000000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "3",
                            "24",
                            "3",
                            "838",
                            "0",
                            "0",
                            "0",
                            "2",
                            "0",
                            "3",
                            "0",
                            "1",
                            "0",
                            "0",
                            "0",
                            "0",
                            "1",
                            "11680",
                            "40243",
                            "51785",
                            "66714",
                            "80486",
                            "23006",
                            "28741",
                            "101226",
                            "11502",
                            "23140",
                            "0",
                            "0",
                            "0",
                            "_total",
                            "0",
                            "0",
                            "0",
                            "1",
                            "0",
                            "0",
                            "0",
                            "50",
                            "5716",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "284",
                            "1977204",
                            "4308720",
                            "6138327",
                            "4308720",
                            "23336",
                            "9",
                            "11651",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "3",
                            "2",
                            "0",
                            "0",
                            "0",
                            "0",
                            "8",
                            "2",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "6743176366056",
                            "130951777565810000",
                            "23004",
                            "2",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "OK",
                        ],
                    ],
                ),
            },
            id="msexch_isstore",
        ),
        pytest.param(
            [
                [
                    "AvailabilityRequestsPersec",
                    "AvailabilityRequestsTotal",
                    "AverageHangTime",
                    "AverageLDAPLatency",
                    "AverageRequestTime",
                    "AverageRPCLatency",
                    "BadItemReportsGeneratedTotal",
                    "Caption",
                    "ConflictingConcurrentSyncPersec",
                    "ConflictingConcurrentSyncTotal",
                    "CreateCollectionCommandsPersec",
                    "CreateCollectionTotal",
                    "CurrentRequests",
                    "DeleteCollectionCommandsPersec",
                    "DeleteCollectionTotal",
                    "Description",
                    "DocumentLibraryFetchCommandsPersec",
                    "DocumentLibraryFetchTotal",
                    "DocumentLibrarySearchesPersec",
                    "DocumentLibrarySearchTotal",
                    "EmptyFolderContentsPersec",
                    "EmptyFolderContentsTotal",
                    "FailedItemConversionTotal",
                    "FolderCreateCommandsPersec",
                    "FolderCreateTotal",
                    "FolderDeleteCommandsPersec",
                    "FolderDeleteTotal",
                    "FolderSyncCommandsPersec",
                    "FolderSyncTotal",
                    "FolderUpdateCommandsPersec",
                    "FolderUpdateTotal",
                    "Frequency_Object",
                    "Frequency_PerfTime",
                    "Frequency_Sys100NS",
                    "GALSearchesPersec",
                    "GALSearchTotal",
                    "GetAttachmentCommandsPersec",
                    "GetAttachmentTotal",
                    "GetHierarchyCommandsPersec",
                    "GetHierarchyTotal",
                    "GetItemEstimateCommandsPersec",
                    "GetItemEstimateTotal",
                    "HeartbeatInterval",
                    "IncomingProxyRequestsTotal",
                    "IRMprotectedMessageDownloadsPersec",
                    "IRMprotectedMessageDownloadsTotal",
                    "ItemOperationsCommandsPersec",
                    "ItemOperationsTotal",
                    "MailboxAttachmentFetchCommandsPersec",
                    "MailboxAttachmentFetchTotal",
                    "MailboxItemFetchCommandsPersec",
                    "MailboxItemFetchTotal",
                    "MailboxOfflineErrorsPerminute",
                    "MailboxSearchesPersec",
                    "MailboxSearchTotal",
                    "MeetingResponseCommandsPersec",
                    "MeetingResponseTotal",
                    "MoveCollectionCommandsPersec",
                    "MoveCollectionTotal",
                    "MoveItemsCommandsPersec",
                    "MoveItemsTotal",
                    "Name",
                    "NumberofADPolicyQueriesonReconnect",
                    "Numberofautoblockeddevices",
                    "NumberofNotificationManagerObjectsinMemory",
                    "OptionsCommandsPersec",
                    "OptionsTotal",
                    "OutgoingProxyRequestsTotal",
                    "PermanentActiveDirectoryErrorsPerminute",
                    "PermanentStorageErrorsPerminute",
                    "PID",
                    "PingCommandsDroppedPersec",
                    "PingCommandsPending",
                    "PingCommandsPersec",
                    "PingDroppedTotal",
                    "PingTotal",
                    "ProvisionCommandsPersec",
                    "ProvisionTotal",
                    "ProxyLogonCommandsSentTotal",
                    "ProxyLogonReceivedTotal",
                    "RecoverySyncCommandsPersec",
                    "RecoverySyncTotal",
                    "RequestsPersec",
                    "RequestsTotal",
                    "SearchCommandsPersec",
                    "SearchTotal",
                    "SendIRMprotectedMessagesPersec",
                    "SendIRMprotectedMessagesTotal",
                    "SendMailCommandsPersec",
                    "SendMailTotal",
                    "SettingsCommandsPersec",
                    "SettingsTotal",
                    "SmartForwardCommandsPersec",
                    "SmartForwardTotal",
                    "SmartReplyCommandsPersec",
                    "SmartReplyTotal",
                    "SyncCommandsDroppedPersec",
                    "SyncCommandsPending",
                    "SyncCommandsPersec",
                    "SyncDroppedTotal",
                    "SyncStateKBytesLeftCompressed",
                    "SyncStateKBytesTotal",
                    "SyncTotal",
                    "Timestamp_Object",
                    "Timestamp_PerfTime",
                    "Timestamp_Sys100NS",
                    "TransientActiveDirectoryErrorsPerminute",
                    "TransientErrorsPerminute",
                    "TransientMailboxConnectionFailuresPerminute",
                    "TransientStorageErrorsPerminute",
                    "WrongCASProxyRequestsTotal",
                ],
                [
                    "0",
                    "0",
                    "0",
                    "0",
                    "53",
                    "0",
                    "0",
                    "",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "1953125",
                    "10000000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "15426",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "13604",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "15426",
                    "15426",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "15426",
                    "15426",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                    "6743176182062",
                    "130951777564870000",
                    "0",
                    "0",
                    "0",
                    "0",
                    "0",
                ],
            ],
            {
                "": WMITable(
                    "",
                    [
                        "availabilityrequestspersec",
                        "availabilityrequeststotal",
                        "averagehangtime",
                        "averageldaplatency",
                        "averagerequesttime",
                        "averagerpclatency",
                        "baditemreportsgeneratedtotal",
                        "caption",
                        "conflictingconcurrentsyncpersec",
                        "conflictingconcurrentsynctotal",
                        "createcollectioncommandspersec",
                        "createcollectiontotal",
                        "currentrequests",
                        "deletecollectioncommandspersec",
                        "deletecollectiontotal",
                        "description",
                        "documentlibraryfetchcommandspersec",
                        "documentlibraryfetchtotal",
                        "documentlibrarysearchespersec",
                        "documentlibrarysearchtotal",
                        "emptyfoldercontentspersec",
                        "emptyfoldercontentstotal",
                        "faileditemconversiontotal",
                        "foldercreatecommandspersec",
                        "foldercreatetotal",
                        "folderdeletecommandspersec",
                        "folderdeletetotal",
                        "foldersynccommandspersec",
                        "foldersynctotal",
                        "folderupdatecommandspersec",
                        "folderupdatetotal",
                        "frequency_object",
                        "frequency_perftime",
                        "frequency_sys100ns",
                        "galsearchespersec",
                        "galsearchtotal",
                        "getattachmentcommandspersec",
                        "getattachmenttotal",
                        "gethierarchycommandspersec",
                        "gethierarchytotal",
                        "getitemestimatecommandspersec",
                        "getitemestimatetotal",
                        "heartbeatinterval",
                        "incomingproxyrequeststotal",
                        "irmprotectedmessagedownloadspersec",
                        "irmprotectedmessagedownloadstotal",
                        "itemoperationscommandspersec",
                        "itemoperationstotal",
                        "mailboxattachmentfetchcommandspersec",
                        "mailboxattachmentfetchtotal",
                        "mailboxitemfetchcommandspersec",
                        "mailboxitemfetchtotal",
                        "mailboxofflineerrorsperminute",
                        "mailboxsearchespersec",
                        "mailboxsearchtotal",
                        "meetingresponsecommandspersec",
                        "meetingresponsetotal",
                        "movecollectioncommandspersec",
                        "movecollectiontotal",
                        "moveitemscommandspersec",
                        "moveitemstotal",
                        "name",
                        "numberofadpolicyqueriesonreconnect",
                        "numberofautoblockeddevices",
                        "numberofnotificationmanagerobjectsinmemory",
                        "optionscommandspersec",
                        "optionstotal",
                        "outgoingproxyrequeststotal",
                        "permanentactivedirectoryerrorsperminute",
                        "permanentstorageerrorsperminute",
                        "pid",
                        "pingcommandsdroppedpersec",
                        "pingcommandspending",
                        "pingcommandspersec",
                        "pingdroppedtotal",
                        "pingtotal",
                        "provisioncommandspersec",
                        "provisiontotal",
                        "proxylogoncommandssenttotal",
                        "proxylogonreceivedtotal",
                        "recoverysynccommandspersec",
                        "recoverysynctotal",
                        "requestspersec",
                        "requeststotal",
                        "searchcommandspersec",
                        "searchtotal",
                        "sendirmprotectedmessagespersec",
                        "sendirmprotectedmessagestotal",
                        "sendmailcommandspersec",
                        "sendmailtotal",
                        "settingscommandspersec",
                        "settingstotal",
                        "smartforwardcommandspersec",
                        "smartforwardtotal",
                        "smartreplycommandspersec",
                        "smartreplytotal",
                        "synccommandsdroppedpersec",
                        "synccommandspending",
                        "synccommandspersec",
                        "syncdroppedtotal",
                        "syncstatekbytesleftcompressed",
                        "syncstatekbytestotal",
                        "synctotal",
                        "timestamp_object",
                        "timestamp_perftime",
                        "timestamp_sys100ns",
                        "transientactivedirectoryerrorsperminute",
                        "transienterrorsperminute",
                        "transientmailboxconnectionfailuresperminute",
                        "transientstorageerrorsperminute",
                        "wrongcasproxyrequeststotal",
                        "wmistatus",
                    ],
                    "name",
                    None,
                    None,
                    [
                        [
                            "0",
                            "0",
                            "0",
                            "0",
                            "53",
                            "0",
                            "0",
                            "",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "1953125",
                            "10000000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "15426",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "13604",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "15426",
                            "15426",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "15426",
                            "15426",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "6743176182062",
                            "130951777564870000",
                            "0",
                            "0",
                            "0",
                            "0",
                            "0",
                            "OK",
                        ],
                    ],
                ),
            },
            id="msexch_activesync",
        ),
    ],
)
def test_parse_wmi_table(
    string_table: StringTable,
    section: WMISection,
) -> None:
    assert parse_wmi_table(string_table) == section


def scale_counter_reference(measure, factor, base):
    # old, inefficient implementation
    # takes ages for the arguments: 18446744073664412644, 1, 15143722
    while (base * factor) < measure:
        base += 1 << 32
    return float(measure) / base


@pytest.mark.parametrize(
    "measure, factor, base",
    [
        (1, 1, 1),
        (2, 1, 1),
        (3, 2, 1),
        ((1 << 32) - 1, 1, 1),
        (1 + (1 << 32), 1, 1),
        (1844674407, 1, 15143722),
        (1844674407, 2, 15143722),
        (1844674407, 13, 15143727),
        (1844674407366441, 1, 15143722),
    ],
)
def test_scale_counter(measure: float, factor: float, base: float) -> None:
    assert (
        abs(scale_counter(measure, factor, base) - scale_counter_reference(measure, factor, base))
        < 1e-15
    )


# https://crash.checkmk.com/gui/crashreportview/show/9d3f1366-4e38-11ef-b6b2-7d71c04640e1
# SIMPLIFIED
# every table consists form the header and a list of rows + key column(usually name)
CRASH_TABLE = [
    ["metric A", "name", "rpcaveragelatency", "wmistatus"],
    ["0", "snacky", "99", "Timeout"],
    ["2409704", "_total", "6", "Timeout"],
]


def test_me():
    wmi_table = WMITable("", CRASH_TABLE[0], "name", 0, None, CRASH_TABLE[1:])
    assert wmi_table.get("_total", "rpcaveragelatency") == "6"
